package com.kede.api.level.controller;

import com.kede.api.except.KedeException;
import com.kede.pojo.ResHttp;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @Author 乔包包
 * @PackageName server-parent-master
 * @Package com.kede.api.level.controller
 * @Date 2024/2/3 15:15
 * @Version 1.0
 */
@Component
public class LevelBaseController {

    @ExceptionHandler(KedeException.class)
    protected ResHttp globalExceptionHandler(KedeException ex){
        return ResHttp.code(ex.getErr().getCode(),ex.getErr().getMsg());
    }
}
